package pandora.bo.DCC;

import pandora.dto.ProductDTO;

public class ProductPar implements Comparable<ProductPar> {
	private ProductDTO product;
	private Integer count;
	
	public ProductPar(ProductDTO p, Integer c){
		this.product = p;
		this.count = c;
	}

	public ProductDTO getProduct() {
		return product;
	}

	public void setProduct(ProductDTO product) {
		this.product = product;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public int compareTo(ProductPar o) {
		if(this.getCount() < o.getCount())
			return -1;
		else if(this.getCount() > o.getCount())
			return 1;
		else
			return 0;
	}
	
	public String toString(){
		return this.product.getProductName()+": "+this.count.toString();
	}
}
